package com.hjj.springboot.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.util.Date;

@TableName("t_comments")
@Data
public class Comment {

    @ExcelProperty("商品评价编号")
    @ColumnWidth(20)
    private Integer id; // 编号

    @ExcelProperty("微信用户OpenId")
    @ColumnWidth(30)
    private String uId; // openId微信用户ID

    @ExcelProperty("商品编号")
    @ColumnWidth(20)
    private Integer gId; // 商品ID

    @ExcelProperty("评价内容")
    @ColumnWidth(30)
    private String comments; //内容

    @JsonSerialize(using=CustomDateTimeSerializer.class)
    @ExcelProperty("评论时间")
    @ColumnWidth(20)
    private Date upTime; // 评论日期

    @ExcelProperty("评分")
    @ColumnWidth(20)
    private Integer scores; // 评分

    @ExcelIgnore
    @TableField(select = false ,exist = false)
    private Product product;  // 商品信息

    @ExcelIgnore
    @TableField(select = false ,exist = false)
    private WxUserInfo wxUserInfo; //用户信息

}
